package com.book.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.criteria.CriteriaBuilder;

/**
 * @program:
 * @ClassName:
 * @description:
 * @author: zgc
 * @date:
 * @Version 1.0
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultBack {
    private Integer code;
    
    private String msg;
    
    private Object data;
    
    public static ResultBack success(String msg, Object data) {
        return new ResultBack(200, msg, data);
    }
    
    public static ResultBack failure(String msg) {
        return new ResultBack(500, msg,null);
    }
}
